using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Numerics;
using Nethereum.Hex.HexTypes;
using Nethereum.ABI.FunctionEncoding.Attributes;
using Nethereum.RPC.Eth.DTOs;
using Nethereum.Contracts.CQS;
using Nethereum.Contracts;
using System.Threading;

namespace Nethereum.Signer.IntegrationTests.BatchCallAndSponsor.ContractDefinition
{


    public partial class BatchCallAndSponsorDeployment : BatchCallAndSponsorDeploymentBase
    {
        public BatchCallAndSponsorDeployment() : base(BYTECODE) { }
        public BatchCallAndSponsorDeployment(string byteCode) : base(byteCode) { }
    }

    public class BatchCallAndSponsorDeploymentBase : ContractDeploymentMessage
    {
        public static string BYTECODE = "0x6080604052348015600e575f5ffd5b50610a2e8061001c5f395ff3fe608060405260043610610033575f3560e01c80633f707e6b146100355780636171d1c914610048578063affed0e01461005b575b005b610033610043366004610690565b610081565b6100336100563660046106cf565b6100d7565b348015610066575f5ffd5b5061006f5f5481565b60405190815260200160405180910390f35b3330146100c95760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420617574686f7269747960781b60448201526064015b60405180910390fd5b6100d382826102a7565b5050565b60605f5b8481101561019e57818686838181106100f6576100f6610768565b9050602002810190610108919061077c565b6101169060208101906107b5565b87878481811061012857610128610768565b905060200281019061013a919061077c565b6020013588888581811061015057610150610768565b9050602002810190610162919061077c565b6101709060408101906107d5565b60405160200161018495949392919061082f565b60408051601f1981840301815291905291506001016100db565b505f5f54826040516020016101b4929190610870565b6040516020818303038152906040528051906020012090505f610203827f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f908152601c91909152603c902090565b90505f6102458287878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061033b92505050565b90506001600160a01b03811630146102935760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b60448201526064016100c0565b61029d88886102a7565b5050505050505050565b5f8054908190806102b783610889565b909155505f90505b828110156102fb576102f38484838181106102dc576102dc610768565b90506020028101906102ee919061077c565b610363565b6001016102bf565b50807f280bb3599696acbf79fb8ffcde81a57337b52500f789600fbb1cff9b4cbaba39848460405161032e9291906108d5565b60405180910390a2505050565b5f5f5f5f610349868661047f565b92509250925061035982826104c8565b5090949350505050565b5f61037160208301836107b5565b6001600160a01b0316602083013561038c60408501856107d5565b60405161039a9291906109b3565b5f6040518083038185875af1925050503d805f81146103d4576040519150601f19603f3d011682016040523d82523d5f602084013e6103d9565b606091505b505090508061041a5760405162461bcd60e51b815260206004820152600d60248201526c10d85b1b081c995d995c9d1959609a1b60448201526064016100c0565b61042760208301836107b5565b6001600160a01b0316337fed7e8f919df9cc0d0ad8b4057d084ebf319b630564d5da283e14751adc931f3a602085013561046460408701876107d5565b604051610473939291906109c2565b60405180910390a35050565b5f5f5f83516041036104b6576020840151604085015160608601515f1a6104a888828585610580565b9550955095505050506104c1565b505081515f91506002905b9250925092565b5f8260038111156104db576104db6109e4565b036104e4575050565b60018260038111156104f8576104f86109e4565b036105165760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561052a5761052a6109e4565b0361054b5760405163fce698f760e01b8152600481018290526024016100c0565b600382600381111561055f5761055f6109e4565b036100d3576040516335e2f38360e21b8152600481018290526024016100c0565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156105b957505f9150600390508261063e565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561060a573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661063557505f92506001915082905061063e565b92505f91508190505b9450945094915050565b5f5f83601f840112610658575f5ffd5b50813567ffffffffffffffff81111561066f575f5ffd5b6020830191508360208260051b8501011115610689575f5ffd5b9250929050565b5f5f602083850312156106a1575f5ffd5b823567ffffffffffffffff8111156106b7575f5ffd5b6106c385828601610648565b90969095509350505050565b5f5f5f5f604085870312156106e2575f5ffd5b843567ffffffffffffffff8111156106f8575f5ffd5b61070487828801610648565b909550935050602085013567ffffffffffffffff811115610723575f5ffd5b8501601f81018713610733575f5ffd5b803567ffffffffffffffff811115610749575f5ffd5b87602082840101111561075a575f5ffd5b949793965060200194505050565b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112610790575f5ffd5b9190910192915050565b80356001600160a01b03811681146107b0575f5ffd5b919050565b5f602082840312156107c5575f5ffd5b6107ce8261079a565b9392505050565b5f5f8335601e198436030181126107ea575f5ffd5b83018035915067ffffffffffffffff821115610804575f5ffd5b602001915036819003821315610689575f5ffd5b5f81518060208401855e5f93019283525090919050565b5f61083a8288610818565b6bffffffffffffffffffffffff198760601b168152856014820152838560348301375f9301603401928352509095945050505050565b8281525f6108816020830184610818565b949350505050565b5f600182016108a657634e487b7160e01b5f52601160045260245ffd5b5060010190565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602080825281018290525f6040600584901b830181019083018583605e1936839003015b878210156109a657868503603f190184528235818112610917575f5ffd5b89016001600160a01b0361092a8261079a565b168652602081013560208701526040810135601e1982360301811261094d575f5ffd5b0160208101903567ffffffffffffffff811115610968575f5ffd5b803603821315610976575f5ffd5b6060604088015261098b6060880182846108ad565b965050506020830192506020840193506001820191506108f9565b5092979650505050505050565b818382375f9101908152919050565b838152604060208201525f6109db6040830184866108ad565b95945050505050565b634e487b7160e01b5f52602160045260245ffdfea26469706673582212204c1ed53b86571808eff9dda15a2ab93205b813afc6a6a5c522985e28f96465bd64736f6c634300081c0033";
        public BatchCallAndSponsorDeploymentBase() : base(BYTECODE) { }
        public BatchCallAndSponsorDeploymentBase(string byteCode) : base(byteCode) { }

    }

    public partial class ExecuteFunction : ExecuteFunctionBase { }

    [Function("execute")]
    public class ExecuteFunctionBase : FunctionMessage
    {
        [Parameter("tuple[]", "calls", 1)]
        public virtual List<Call> Calls { get; set; }
    }

    public partial class Execute1Function : Execute1FunctionBase { }

    [Function("execute")]
    public class Execute1FunctionBase : FunctionMessage
    {
        [Parameter("tuple[]", "calls", 1)]
        public virtual List<Call> Calls { get; set; }
        [Parameter("bytes", "signature", 2)]
        public virtual byte[] Signature { get; set; }
    }

    public partial class NonceFunction : NonceFunctionBase { }

    [Function("nonce", "uint256")]
    public class NonceFunctionBase : FunctionMessage
    {

    }

    public partial class BatchExecutedEventDTO : BatchExecutedEventDTOBase { }

    [Event("BatchExecuted")]
    public class BatchExecutedEventDTOBase : IEventDTO
    {
        [Parameter("uint256", "nonce", 1, true )]
        public virtual BigInteger Nonce { get; set; }
        [Parameter("tuple[]", "calls", 2, false )]
        public virtual List<Call> Calls { get; set; }
    }

    public partial class CallExecutedEventDTO : CallExecutedEventDTOBase { }

    [Event("CallExecuted")]
    public class CallExecutedEventDTOBase : IEventDTO
    {
        [Parameter("address", "sender", 1, true )]
        public virtual string Sender { get; set; }
        [Parameter("address", "to", 2, true )]
        public virtual string To { get; set; }
        [Parameter("uint256", "value", 3, false )]
        public virtual BigInteger Value { get; set; }
        [Parameter("bytes", "data", 4, false )]
        public virtual byte[] Data { get; set; }
    }

    public partial class ECDSAInvalidSignatureError : ECDSAInvalidSignatureErrorBase { }
    [Error("ECDSAInvalidSignature")]
    public class ECDSAInvalidSignatureErrorBase : IErrorDTO
    {
    }

    public partial class ECDSAInvalidSignatureLengthError : ECDSAInvalidSignatureLengthErrorBase { }

    [Error("ECDSAInvalidSignatureLength")]
    public class ECDSAInvalidSignatureLengthErrorBase : IErrorDTO
    {
        [Parameter("uint256", "length", 1)]
        public virtual BigInteger Length { get; set; }
    }

    public partial class ECDSAInvalidSignatureSError : ECDSAInvalidSignatureSErrorBase { }

    [Error("ECDSAInvalidSignatureS")]
    public class ECDSAInvalidSignatureSErrorBase : IErrorDTO
    {
        [Parameter("bytes32", "s", 1)]
        public virtual byte[] S { get; set; }
    }





    public partial class NonceOutputDTO : NonceOutputDTOBase { }

    [FunctionOutput]
    public class NonceOutputDTOBase : IFunctionOutputDTO 
    {
        [Parameter("uint256", "", 1)]
        public virtual BigInteger ReturnValue1 { get; set; }
    }
}
